package com.qianfeng.missfood.constants;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * Created by Administrator on 15-8-17.
 */
public class UrlConstants {

    public static String startUrl = "http://api.mishi.cn/appConfig/configCenter/?_method=GET&p-pv=1.0&p-apiv=1.0&appVersion=1.7.1.32&isAutoUpgrade=true&deviceId=865479024746562&osType=11%20HTTP/1.1";

    public static String cookUrl = "http://api.mishi.cn/chef/guide/?_method=GET&p-pv=1.0&p-apiv=2.0";

    public static String foodRootUrl = "http://api.mishi.cn/index/goods/home/?_method=GET&p-pv=1.0&p-apiv=1.0&pageSize=10&";

    public static String getFoodUrl(String cityCode, int currentPage, Double lng, Double lat, String city){
        String cityEncode = null;
        try {
            cityEncode = URLEncoder.encode(city, "utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return foodRootUrl + "cityCode=" + cityCode + "&lng=" + lng + "&currentPage=" + currentPage + "&lat=" +lat + "&city=" + cityEncode;
    }

    public static String getFoodUrl(int currentPage){
        return foodRootUrl + "currentPage=" + currentPage;
    }

    public static String categoryUrl="http://api.mishi.cn/categories/foreground/1_3/?_method=GET&p-pv=1.0&p-apiv=3.0&step=-1&categoryId=0";

    public static String categoryGridViewUrl="http://api.mishi.cn/categories/foreground/1_3/?_method=GET&p-pv=1.0&p-apiv=3.0&step=-1&categoryId=0";


}
